From fe0b76ce48e2ae95dc0613bd8d86cead30dc4a55 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 4 Feb 2024 08:43:58 -0800
Subject: feat(badges): use imgur thumbnail

---
 src/routes/user/[user]/badges/+page.svelte | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/routes/user/[user]/badges/+page.svelte')

diff --git a/src/routes/user/[user]/badges/+page.svelte b/src/routes/user/[user]/badges/+page.svelte
index f40837ed..365fdb9b 100644
--- a/src/routes/user/[user]/badges/+page.svelte
+++ b/src/routes/user/[user]/badges/+page.svelte
@@ -287,6 +287,9 @@
 		if (url && url.includes('catbox.moe') && !url.includes('gif'))
 			return url.replace('catbox.moe/', 'catbox.moe/thumbs/t_');
 
+		if (url && url.includes('imgur') && !url.includes('gif'))
+			return url.replace(/(\.\w+)$/, '_d.webp?maxwidth=144&shape=thumb&fidelity=high');
+
 		if (url && url.includes('discordapp')) {
 			const match = url.match(/attachments\/(\d+)\/(\d+)\/(.+)/);
 
-- 
cgit v1.2.3

